<?php
	$path = "../";
	include_once($path.'configuration.php');
	/*traitements*/
	include_once($path.'head.php');
?>
	<div id="bodyWrapper">
		<h1>GESTION DES MACHINES</h1>
		<a href="<?php echo $path; ?>administration/add_machine.php">AJOUTER</a>
		<table>
			<tr>
				<th>
					id machine
				</th>		
				<th>
					Nom
				</th>
				<th>
					Salle
				</th>
				<th>
					Adresse IP
				</th>
				<th>
				
				</th>
				<th>
				
				</th>
			</tr>
			<?php
				$liste_machine =$dbh->getAllmachine();
				foreach ($liste_machine as $machine){
			?>
				<tr>
					<td>
						<?php echo $machine['id_machine']; ?>
					</td>
					<td>
						<?php echo $machine['nom']; ?>
					</td>
					<td>
						<?php echo $machine['salle']; ?>
					</td>
					<td>
						<?php echo $machine['IP']; ?>
					</td>
					<td>
						<a href="<?php echo $path; ?>administration/add_machine.php?action=modif&machine=<?php echo $machine['id_machine']; ?>"> MODIFIER </a>
					</td>
					<td>
						<a href="<?php echo $path; ?>administration/add_machine.php?action=delete&machine=<?php echo $machine['id_machine']; ?>"> SUPPRIMER </a>
					</td>
				</tr>
			<?php
			}
			?>
		</table>
	</div>
<?php
	include_once($path.'footer.php');
?>